package com.li.service.impl;

import com.github.pagehelper.PageHelper;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.li.pojo.Feedback;
import com.li.mappers.FeedbackMapper;
import com.li.service.FeedbackService;

import java.util.List;

/**
@author sun
@date 2022/5/17 - 21:16
*/
@Service
public class FeedbackServiceImpl implements FeedbackService{

    @Resource
    private FeedbackMapper feedbackMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return feedbackMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Feedback record) {
        return feedbackMapper.insert(record);
    }

    @Override
    public int insertSelective(Feedback record) {
        return feedbackMapper.insertSelective(record);
    }

    @Override
    public Feedback selectByPrimaryKey(Integer id) {
        return feedbackMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Feedback record) {
        return feedbackMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Feedback record) {
        return feedbackMapper.updateByPrimaryKey(record);
    }
    @Override
    public List<Feedback> findFeedback(Feedback feedBack,Integer pageNum,Integer pageSize){

        if (pageNum==null){
            pageNum=1;
        }
        if (pageSize==null){
            pageSize=10;
        }
        PageHelper.startPage(pageNum,pageSize);
        return feedbackMapper.findFeedback(feedBack);
    }

}
